<?php $this->placeholder('onReady')->captureStart() ?>
	$("#<?php echo $this->id_tablesorter?>").tablesorter(); 
<?php $this->placeholder('onReady')->captureEnd() ?>



<table id="<?= $this->id_tablesorter?>" width="100%" class="tablesorter"> 
    <caption>
       <div id="total_table_filter" style="float: right;">Total <span class="filtradas"><?=count($this->rows)?> Registros</span></div>    
    </caption>
<thead>
<tr>

<?foreach($this->columnas as $v):?>
    <th><?php echo $this->translate($v['header']);?></th>
<?endforeach?>

</tr>
</thead>
<tbody>
<?foreach($this->rows as $k => $v):?>
<tr>
    <td><?=$v['fecha']?></td>
    <td><?=$this->NumEs($v['consumo_total'],0)?></td>
    <td><?=$this->NumEs($v['consumo_it'],0)?></td>
    <td><?=$this->NumEs($v['consumo_servicios'],0)?></td>
    <td><?=$this->NumEs($v['potencia_total'],0)?></td>
    <td><?=$this->NumEs($v['potencia_it'],0)?></td>
    <td><?=$this->NumEs($v['potencia_servicios'],0)?></td>
    <td><?=$this->NumEs($v['incremento'],2);?></td>
    <td><?=$this->NumEs($v['pue'],4);?></td>
    <td><?=$this->NumEs($v['facturado_compania'],0);?></td>
    <td><?=$this->NumEs($v['imputacion'],0);?></td>
    <td><?=$this->NumEs($v['facturacion'],0);?></td>
    <td><?=$this->NumEs($v['ratio_reventa'],2)?></td>
</tr>
<?endforeach?>
</tbody>
<tfoot>
<tr>
    <th></th>
    <th><?php echo $this->numES($this->suma['consumo_total'],0);?> kWh</th>
    <th><?php echo $this->numES($this->suma['consumo_it'],0);?> kWh</th>
    <th><?php echo $this->numES($this->suma['consumo_servicios'],0);?> kWh</th>
    <th><?php echo $this->numES($this->suma['potencia_total'],0);?> kW</th>
    <th><?php echo $this->numES($this->suma['potencia_it'],0);?> kW</th>
    <th><?php echo $this->numES($this->suma['potencia_servicios'],0);?> kW</th>
    <th></th>
    <th><?php echo $this->numES($this->suma['pue'],4);?></th>
    <th><?php echo $this->numES($this->suma['facturado_compania'],0);?> €</th>
    <th><?php echo $this->numES($this->suma['imputacion'],0);?> €</th>
    <th><?php echo $this->numES($this->suma['facturacion'],0);?> €</th>
    <th><?php echo $this->numES($this->suma['ratio_reventa'],0);?> %</th>
</tr>
</tfoot>
</table>




